<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>货损货差管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">
		var validateForm;
		var $table; // 父页面table表格id
		var $topIndex;//弹出窗口的 index
		function doSubmit(table, index){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $table = table;
			  $topIndex = index;
			  jp.loading();
			  $("#inputForm").submit();
			  return true;
		  }

		  return false;
		}

		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					jp.post("${ctx}/ap/damaged/save",$('#inputForm').serialize(),function(data){
						if(data.success){
	                    	$table.bootstrapTable('refresh');
	                    	jp.success(data.msg);
	                    	jp.close($topIndex);//关闭dialog

	                    }else{
            	  			jp.error(data.msg);
	                    }
					})
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
	        $('#rq').datetimepicker({
				 format: "YYYY-MM-DD"
		    });
	        $('#pfrq').datetimepicker({
				 format: "YYYY-MM-DD"
		    });
	        $('#zssj').datetimepicker({
				 format: "YYYY-MM-DD"
		    });
		});
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="damaged" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		<table class="table table-bordered">
		   <tbody>
		   <tr style="background-color: grey;color: red">
			   <td colspan="4" align="center" >货损情况</td>
		   </tr>



				<tr>
					<td class="width-15 active"><label class="pull-right">项目：</label></td>
					<td class="width-35">
						<form:input path="pro" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">日期：</label></td>
					<td class="width-35">
						<p class="input-group">
							<div class='input-group form_datetime' id='rq'>
			                    <input type='text'  name="rq" class="form-control"  value="<fmt:formatDate value="${damaged.rq}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>
			            </p>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">起运地：</label></td>
					<td class="width-35">
						<form:input path="qyd" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">送达地：</label></td>
					<td class="width-35">
						<form:input path="dzd" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">类型：</label></td>
					<td class="width-35">
						<form:input path="type" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">托运合同号：</label></td>
					<td class="width-35">
						<form:input path="hth" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">回执单号/提货单号：</label></td>
					<td class="width-35">
						<form:input path="thdh" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">货损货差产品描述：</label></td>
					<td class="width-35">
						<form:input path="cpms" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">货损货差产品数量：</label></td>
					<td class="width-35">
						<form:input path="cpsl" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">货损货差产品规格：</label></td>
					<td class="width-35">
						<form:input path="cpgg" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">货值：</label></td>
					<td class="width-35">
						<form:input path="hz" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">货损货差原因描述：</label></td>
					<td class="width-35">
						<form:input path="yyms" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">责任方：</label></td>
					<td class="width-35">
						<form:input path="zrf" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">责任人：</label></td>
					<td class="width-35">
						<form:input path="zrr" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">公司承担金额：</label></td>
					<td class="width-35">
						<form:input path="gscdje" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">追损状态：</label></td>
					<td class="width-35">
						<form:input path="sfwc" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
		   <tr>
			   <td class="width-15 active"><label class="pull-right">单据状态：</label></td>
			   <td class="width-35">
				   <form:input path="status" htmlEscape="false"   readonly="true"  class="form-control "/>
			   </td>
			   <td class="width-15 active"><label class="pull-right">赔付状态：</label></td>
			   <td class="width-35">
				   <form:input path="pfstatus" htmlEscape="false"    class="form-control "/>
			   </td>
		   </tr>
		   <tr>
			   <td class="width-15 active"><label class="pull-right">单号：</label></td>
			   <td class="width-35">
				   <form:input path="code" htmlEscape="false" readonly="true"   class="form-control "/>
			   </td>
			   <td class="width-15 active"><label class="pull-right">备注：</label></td>
			   <td class="width-35">
				   <form:input path="remarks" htmlEscape="false"    class="form-control "/>
			   </td>
		   </tr>

		   <tr style="background-color: grey;color: red">
			   <td colspan="4" align="center" >残值情况</td>
		   </tr>
		   <tr>
			   <td class="width-15 active"><label class="pull-right">残值暂存地及接收人：</label></td>
			   <td class="width-35">
				   <form:input path="czzc" htmlEscape="false"    class="form-control "/>
			   </td>
			   <td class="width-15 active"><label class="pull-right">残值处理接收地及接收人：</label></td>
			   <td class="width-35">
				   <form:input path="czcl" htmlEscape="false"    class="form-control "/>
			   </td>
		   </tr>
		   <tr>
			   <td class="width-15 active"><label class="pull-right">残值情况描述：</label></td>
			   <td class="width-35">
				   <form:input path="czqkms" htmlEscape="false"    class="form-control "/>
			   </td>
			   <td class="width-15 active"><label class="pull-right">处理方案：</label></td>
			   <td class="width-35">
				   <form:input path="clfa" htmlEscape="false"    class="form-control "/>
			   </td>
		   </tr>
		   <tr style="background-color: grey;color: red">
			   <td colspan="4" align="center" >赔付情况</td>
		   </tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">赔付方式：</label></td>
					<td class="width-35">
						<form:input path="pffs" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">赔付金额：</label></td>
					<td class="width-35">
						<form:input path="pfje" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">赔付日期：</label></td>
					<td class="width-35">
						<p class="input-group">
						<div class='input-group form_datetime' id='pfrq'>
							<input type='text'  name="pfrq" class="form-control"  value="<fmt:formatDate value="${damaged.pfrq}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
							<span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
						</div>
						</p>
					</td>
					<td class="width-15 active"><label class="pull-right">赔付情况描述：</label></td>
					<td class="width-35">
						<form:input path="pfqkms" htmlEscape="false"    class="form-control "/>
					</td>

				</tr>
		   <tr style="background-color: grey;color: red">
			   <td colspan="4" align="center" >追损情况</td>
		   </tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">追损到账金额：</label></td>
					<td class="width-35">
						<form:input path="zsdzje" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">最后追损时间：</label></td>
					<td class="width-35">

							<div class='input-group form_datetime' id='zssj'>
			                    <input type='text'  name="zssj" class="form-control"  value="<fmt:formatDate value="${damaged.zssj}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>

					</td>

				</tr>


		 	</tbody>
		</table>
	</form:form>
</body>
</html>